package net.wanho.controller;

import lombok.RequiredArgsConstructor;
import net.wanho.service.UnitService;
import net.wanho.vo.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/unit")
@RequiredArgsConstructor
public class UnitController {
    private final UnitService unitService;

    /**
     *  所有单位列表
     */
    @GetMapping("/unit-list")
    public AjaxResult unitList() {
        return AjaxResult.success(unitService.list());
    }
}
